home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / ezmouse2.zip / EZMOUSE.DOC next >
Text File  |  1996-06-20  |  11KB  |  236 lines

  1. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2. *                       DOCUMENTATION FOR EZ-MOUSE 2.0                       *
  3. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4.  
  5. EZ-Mouse Ver 2.0: Copyright (c) 1996, by Jeff Weinstein.
  6.                   All rights reserved.
  7.  
  8.         Table Of Contents...............................
  9.  
  10.                         Introduction....................1
  11.                         What's New......................2
  12.                         List Of Variables...............3
  13.                         List Of Procedures..............4
  14.                         Where To Find Cusor Editors.....5
  15.  
  16.  
  17.  
  18. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-1-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  19.  
  20.         EZ-Mouse is a small unit file for Turbo Pascal 7.0 users, in need
  21. of some mouse routines.  I wrote this little utility out of my own need, and
  22. then I decided to release it as shareware.  I tried to make all the procedures
  23. and variables as easy to understand as possible; no sense in making 
  24. programming any more difficult.  Basically, EZ-Mouse is a set of 11 mouse
  25. routines, which work in text/graphics mode.  
  26. See below for full details on the variables and procedures.
  27.         
  28.  
  29. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  30.  
  31. What's new in Version 2.0?  A couple of things.  The biggest thing is the
  32. addition of 2 new procedures, ResetMouse, and ChangeCursor.  ResetMouse
  33. does just what you think: resets the mouse back to normal.  So, if you have
  34. just confined the mouse to a window, or changed the cursor, this procedure
  35. puts things back the way they were before.  The ChangeCursor procedure is
  36. also self-explanitory.  It creates a new mouse cursor on the screen (only in
  37. graphics mode).  You will need the aid of a mouse cursor design program that
  38. can save in .PAS format.  I'll include a list and where to get them at the
  39. end of this document.  Lastly, I changed the ConfineMouse procedure to make
  40. things a bit easier, see below.
  41.  
  42. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-3-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  43.  
  44.         Here's a list of constants and variables and a description
  45. of their functions.  You don't need to declare any of these variables in your
  46. programs, they are already in the .TPU file.  In other words, you can use 
  47. these variables as is, no need to declare anything.
  48.  
  49. CONSTANTS:
  50.       **LEFT_BUTTON = 0;
  51.       **RIGHT_BUTTON = 1;
  52.  
  53. What is this stuff you ask?  In a couple of the procedures you are required
  54. to pass an integer telling it which mouse button you want info
  55. on.  Instead of calling a procedure and passing, say 0, for the left mouse
  56. button, you just call the procedure with LEFT_BUTTON.  No big reason for this,
  57. just makes things a little easier.
  58.  
  59. VARIABLES:
  60.       **MouseInstalled : Integer;
  61.  
  62. This is an integer variable that equals 0 if the mouse is not installed, and
  63. -1 if it is installed.  This variable is set after a call to the InstallMouse
  64. procedure.
  65.  
  66.       **NumberOfButtons : Integer;
  67.  
  68. This variable holds the number of buttons that are on the mouse.  It is set
  69. after a call to InstallMouse.
  70.  
  71.       **MouseX, MouseY : Integer;
  72.  
  73. These variables hold the mouse's (X,Y) position.  When you make a call to
  74. MouseXY, it sets MouseX and MouseY to wherever the mouse is.  I.E., if the
  75. mouse is at (50,70) when you make the call to MouseXY, then MouseX and MouseY
  76. equal 50 and 70, respectively.
  77.  
  78.       **LeftPressed, RightPressed : Integer;
  79.  
  80. These variables equal -1 each if the mouse button is being held down when
  81. the call to ButtonPress is made, 0 if the button is up.
  82.  
  83.       **ButtonX, ButtonY : Integer;
  84.  
  85. When you call the ButtonClick routine, it returns where the last mouse click
  86. was in the above variables.  
  87.  
  88.       **MouseMajor, MouseMinor : Byte;
  89.  
  90. When you call the MouseInfo routine, it gets the mouse version number.
  91. The major number is store in MouseMajor, the minor in MouseMinor.  Don't
  92. worry about the fact that they're bytes, you can use these variables just as
  93. if they were integers.  In the number 6.2, 6 is the major version and 2 is
  94. the minor version.
  95.  
  96.       **MouseType : EMouseType;
  97.  
  98. This is an enumeration (big word :).  After a call to MouseInfo, the procedure
  99. returns what type of mouse it is.  The mouse can be either one of these types:
  100. BUS mouse (this value is 1); SERIAL mouse (this value is 2); INPORT mouse
  101. (this value is 3); PS2 (this value is 4); Hewlette Packard mouse (HP, value
  102. is 4).  What's up with the enumeration stuff?  Well, in your code, instead
  103. of writing: IF MouseType=4 THEN....., you just write:
  104. IF MouseType=PS2 THEN...., makes things a bit easier.
  105.  
  106.       **MouseIRQ : Byte;
  107.  
  108. Tells you what IRQ the mouse is on.  Simple as that.
  109.  
  110. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-4-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  111.  
  112.         Here's a list of procedures, followed by their descriptions:
  113.  
  114.  
  115. PROCEDURES:
  116.  
  117.         **InstallMouse;
  118.  
  119. This is called only once in your program, if you do it more the mouse acts
  120. funky.  This procedures initializes all the mouse data, etc.  You won't
  121. see the mouse, however, until you make a call to the procedure below:
  122.  
  123.         **ShowMouse;
  124.  
  125. This does just what it says.  It makes the mouse visible on the screen.
  126.  
  127.         **HideMouse;
  128.  
  129. Another self-explanatory procedure.  If the mouse is visible, it won't be
  130. after a call to this routine. 
  131.  
  132.         **MouseXY;
  133.  
  134. This retrieves the (X,Y) coordinates of the mouse.  This value is the same
  135. regardless of what video mode you're in.  The value of X will be between
  136. 0 and 639, and the value of Y will be between 0 and 199.  The coordinates are
  137. stored in the variables MouseX, and MouseY.
  138.  
  139.         **ButtonPress;
  140.  
  141. This procedure determines if a mouse button or buttons is/are being held 
  142. down during a call to this procedure.  If the left button is being pressed,
  143. then the variable LeftPressed=-1, if the right is pressed then RightPressed=-1
  144. if neither are pressed, then they both equal 0. 
  145.  
  146.         **SetMouseXY( X, Y : Integer);
  147.  
  148. This routine moves the mouse cursor to the (X,Y) coordinates that you 
  149. specify.  Again, the value for X must be between 0-639, and Y must be from
  150. 0-199.
  151.  
  152.         **ButtonClick( Button : Integer);
  153.  
  154. When you call this procedure, you must specify for what button you want
  155. info on.  For the left button, call the function like this:
  156. ButtonClick(LEFT_BUTTON);
  157. for the right button, call it: ButtonClick(RIGHT_BUTTON);
  158. This procedure returns the coordinates of the last mouse click (for whatever
  159. button you specified) in variables ButtonX, and ButtonY.
  160.  
  161.         **ConfineMouse( MinX, MinY, MaxX, MaxY : Integer);
  162.  
  163.         NOTE THE ABOVE DIFFERENCE FROM VER. 1.0!!!!!!
  164.  
  165. In Version 1.0, ConfineMouse was called like this:
  166. ConfineMouse(MinX, MaxX, MinY, MaxY : Integer);
  167. I decided to change it so that you passed coordinates.  It just seems more
  168. natural to call it that way.
  169. This procedure makes it so that the mouse can only move in the rectangular
  170. box that you specify.  MinX is the lowest X coordinate the mouse can move to,
  171. MaxX is the highest, MinY is the lowest Y coordinate, and MaxY is the highest.
  172. For example, to confine the mouse to the rectangular region between 
  173. X coordinates 0-100, and Y coordinates 0-150, do the following:
  174. ConfineMouse( 0, 0, 100, 150);
  175. NOTE THE DIFFERENCE (ONCE AGAIN) IN THE EXAMPLE FROM VER. 1.0!
  176.  
  177.         **NormalConfine;
  178.  
  179. This just makes it so that the mouse can move anywhere on the screen; the
  180. way it normally is when you first call InstallMouse.  Use this when you
  181. don't want the mouse confined to that region you set using ConfineMouse.
  182.  
  183.         **MouseInfo;
  184.  
  185. This last routine returns the following: The major mouse version number
  186. in MouseMajor; the minor version number in MouseMinor; what type of mouse it
  187. is in MouseType (see part 2 for details on this variable); and what IRQ the
  188. mouse is on in MouseIRQ.  In the number 6.02, 6 is the major version number,
  189. and 02 is the minor version number.
  190.  
  191.         **ResetMouse;
  192.  
  193. This does just what it says.  If you've been mucking aroun